package com.norriekoelle.virtualsensors.client;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;

import com.norriekoelle.virtualsensors.R;

/**
 * Activity to provide a menu between creating hotspots and the bookshelf app.
 *  
 * @author Lauren Norrie (norrielm)
 */
// TODO(norrielm): Merge this with the bookshelf app once hotspot creation is available in there
// or make the interface easier to navigate for creating hotspots. 
public class MainActivity extends Activity {
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
    
        Button b = (Button) findViewById(R.id.startHotButton);
        b.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View unused) {
				Intent intent = new Intent(MainActivity.this, HotspotActivity.class);
				startActivity(intent);
			}
        }); 
        
        b = (Button) findViewById(R.id.startExperimentA);
        b.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View unused) {
				Intent intent = new Intent(MainActivity.this, BookshelfActivity.class);
				intent.putExtra(BookshelfActivity.IN_PHONE_ONLY_MODE_KEY, true);
				startActivity(intent);
			}
        });
        
        b = (Button) findViewById(R.id.startExperimentK);
        b.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View unused) {
				Intent intent = new Intent(MainActivity.this, BookshelfActivity.class);
				intent.putExtra(BookshelfActivity.IN_PHONE_ONLY_MODE_KEY, false);
				startActivity(intent);
			}
        }); 
    }     
}
